import React from 'react';
import ProLayout from '@ant-design/pro-layout';
import { Link } from 'umi';

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function BasicLayout (props: any) {
  return (
    <div
      style={{ height: '100vh' }}
    >
      <ProLayout
        rightContentRender={() => (
          <div>
            square
          </div>
        )}
        {...props}
        menuItemRender={(menuItemProps, defaultDom) => {
          if (
            menuItemProps.isUrl ||
            !menuItemProps.path ||
            location.pathname === menuItemProps.path
          ) {
            return defaultDom;
          }
          return <Link to={menuItemProps.path}>{defaultDom}</Link>;
        }}
      >
        {props.children}
      </ProLayout>
    </div>
  )
}

export default BasicLayout;
